package com.superatom.springframework.beans.factory.config;

import com.superatom.springframework.beans.BeansException;
import com.superatom.springframework.lang.Nullable;

public interface BeanExpressionResolver {

    /**
     * Evaluate the given value as an expression, if applicable;
     * return the value as-is otherwise.
     * @param value the value to check
     * @param evalContext the evaluation context
     * @return the resolved value (potentially the given value as-is)
     * @throws BeansException if evaluation failed
     */
    @Nullable
    Object evaluate(@Nullable String value, BeanExpressionContext evalContext) throws BeansException;

}
